package modelo;

import java.io.Serializable;

import java.math.BigDecimal;

import java.sql.Timestamp;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@NamedQueries( { @NamedQuery(name = "Users.findAll", query = "select o from Users o"),
                 @NamedQuery(name = "Users.porfecha", query = "select o from Users o where o.fechacreacion between :paramFecha1 and :paramFecha2"),
                 @NamedQuery(name = "Users.fechaID", query = "select o from Users o where o.fechacreacion = '2013-01-29' and o.sesion=1;"),
                 @NamedQuery(name = "Users.busqueda", query = "select o from Users o where o.rfce =:paramValor';"),
                 @NamedQuery(name = "Users.busquedaLog", query = "select o from Users o where o.login =:paramValor';"),
                 @NamedQuery(name = "Users.busquedaPass", query = "select o from Users o where o.password =:paramValor';"),
                 @NamedQuery(name = "Users.login", query = "select o from Users o where o.login = :paramLogin and o.password =:paramPass ;"),
                 @NamedQuery(name = "Users.ordenados",query = "SELECT o FROM Users o GROUP BY o.fechacreacion ORDER BY o.fechacreacion DESC")})
@Table(name = "\"users\"")
public class Users implements Serializable {
    @Temporal(TemporalType.DATE)
    @Column(name = "fechacambiopassword")
    private Date fechacambiopassword;
    @Temporal(TemporalType.DATE)
    @Column(name = "fechacreacion", nullable = false)
    private Date fechacreacion;
    @Temporal(TemporalType.DATE)
    @Column(name = "fechamensajeaviso")
    private Date fechamensajeaviso;
    @Column(name = "horasession", nullable = false)
    private Timestamp horasession;
    @Column(name = "login", nullable = false)
    private String login;
    @Column(name = "password", nullable = false)
    private String password;
    @Column(name = "password_1")
    private String password_1;
    @Column(name = "password_2")
    private String password_2;
    @Column(name = "password_3")
    private String password_3;
    @Column(name = "primerasession")
    private BigDecimal primerasession;
    @Id
    @Column(name = "rfce", nullable = false)
    private String rfce;
    @Column(name = "sesion")
    private byte sesion;
    @Column(name = "statuscuenta")
    private BigDecimal statuscuenta;
    @Column(name = "statussession")
    private BigDecimal statussession;
    @Temporal(TemporalType.DATE)
    @Column(name = "ultimaconexion", nullable = false)
    private Date ultimaconexion;
    @Column(name = "versioncomercial", nullable = false)
    private BigDecimal versioncomercial;

    public Users() {
    }

    public Users(Date fechacambiopassword, Date fechacreacion, Date fechamensajeaviso, Timestamp horasession,
                 String login, String password, String password_1, String password_2, String password_3,
                 BigDecimal primerasession, String rfce, byte sesion, BigDecimal statuscuenta,
                 BigDecimal statussession, Date ultimaconexion, BigDecimal versioncomercial) {
        this.fechacambiopassword = fechacambiopassword;
        this.fechacreacion = fechacreacion;
        this.fechamensajeaviso = fechamensajeaviso;
        this.horasession = horasession;
        this.login = login;
        this.password = password;
        this.password_1 = password_1;
        this.password_2 = password_2;
        this.password_3 = password_3;
        this.primerasession = primerasession;
        this.rfce = rfce;
        this.sesion = sesion;
        this.statuscuenta = statuscuenta;
        this.statussession = statussession;
        this.ultimaconexion = ultimaconexion;
        this.versioncomercial = versioncomercial;
    }

    public Date getFechacambiopassword() {
        return fechacambiopassword;
    }

    public void setFechacambiopassword(Date fechacambiopassword) {
        this.fechacambiopassword = fechacambiopassword;
    }

    public Date getFechacreacion() {
        return fechacreacion;
    }

    public void setFechacreacion(Date fechacreacion) {
        this.fechacreacion = fechacreacion;
    }

    public Date getFechamensajeaviso() {
        return fechamensajeaviso;
    }

    public void setFechamensajeaviso(Date fechamensajeaviso) {
        this.fechamensajeaviso = fechamensajeaviso;
    }

    public Timestamp getHorasession() {
        return horasession;
    }

    public void setHorasession(Timestamp horasession) {
        this.horasession = horasession;
    }

    public String getLogin() {
        return login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPassword_1() {
        return password_1;
    }

    public void setPassword_1(String password_1) {
        this.password_1 = password_1;
    }

    public String getPassword_2() {
        return password_2;
    }

    public void setPassword_2(String password_2) {
        this.password_2 = password_2;
    }

    public String getPassword_3() {
        return password_3;
    }

    public void setPassword_3(String password_3) {
        this.password_3 = password_3;
    }

    public BigDecimal getPrimerasession() {
        return primerasession;
    }

    public void setPrimerasession(BigDecimal primerasession) {
        this.primerasession = primerasession;
    }

    public String getRfce() {
        return rfce;
    }

    public void setRfce(String rfce) {
        this.rfce = rfce;
    }

    public byte getSesion() {
        return sesion;
    }

    public void setSesion(byte sesion) {
        this.sesion = sesion;
    }

    public BigDecimal getStatuscuenta() {
        return statuscuenta;
    }

    public void setStatuscuenta(BigDecimal statuscuenta) {
        this.statuscuenta = statuscuenta;
    }

    public BigDecimal getStatussession() {
        return statussession;
    }

    public void setStatussession(BigDecimal statussession) {
        this.statussession = statussession;
    }

    public Date getUltimaconexion() {
        return ultimaconexion;
    }

    public void setUltimaconexion(Date ultimaconexion) {
        this.ultimaconexion = ultimaconexion;
    }

    public BigDecimal getVersioncomercial() {
        return versioncomercial;
    }

    public void setVersioncomercial(BigDecimal versioncomercial) {
        this.versioncomercial = versioncomercial;
    }
}
